home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HPAVC
/
HPAVC CD-ROM.iso
/
ARASAN_S.ZIP
/
OPTIONS.H
< prev
next >
Wrap
C/C++ Source or Header
|
1994-07-16
|
2KB
|
92 lines
// Copyright 1993 by Jon Dart. All Rights Reserved.
#ifndef _OPTIONS_H
#define _OPTIONS_H
#include "search.h"
#include "timectrl.h"
#include "types.h"
#include <string.h>
#define Max_Time_Controls 2
struct Preferences
{
Boolean beep_after_move;
Boolean beep_on_error;
Boolean can_resign;
Boolean randomize_moves;
Boolean use_book;
Boolean think_when_idle;
};
class Options
{
public:
Options();
virtual ~Options();
const Time_Control &get_time_control(
Control c = First ) const
{
return tc[c];
}
void set_time_control( const Time_Control &t,
Control c = First )
{
tc[c] = t;
}
Boolean beep_after_move() const
{
return prefs.beep_after_move;
}
Boolean beep_on_error() const
{
return prefs.beep_on_error;
}
Boolean can_resign() const
{
return prefs.can_resign;
}
Boolean use_book() const
{
return prefs.use_book;
}
Boolean randomize_moves() const
{
return prefs.randomize_moves;
}
Boolean think_when_idle() const
{
return prefs.think_when_idle;
}
void update_preferences( const Preferences &p );
void get_preferences( Preferences &p );
void save();
private:
Time_Control tc[2];
Preferences prefs;
void get_src_opts( const Control c,
Search_Type &my_search_type, Search_Limit &my_search_limit);
void set_src_opts( const Control c,
const Search_Type my_search_type,
const Search_Limit &my_search_limit);
};
#endif